package com.ntes.consumer3.controller;

import com.ntes.consumer3.service.IDemo1Service;
import com.ntes.consumer3.service.IDemoService;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by bjliuyue1 on 2017/5/21.
 */
@RestController
public class DemoController {

    @Autowired
    private IDemoService demoService;
    @Autowired
    private IDemo1Service demo1Service;

    @RequestMapping("string")
    public String string(HttpServletRequest request) {
        return demoService.getString(request.getParameter("name")) + " consumer3";
    }

    @RequestMapping("consumer3/str")
    public String str(HttpServletRequest request) {
        return demoService.getString(request.getParameter("name")) + " consumer3";
    }

    @RequestMapping("string1")
    public String string1(HttpServletRequest request) {
        return demo1Service.getString(request.getParameter("name")) + " consumer3";
    }
}
